﻿@model CSEPT.Models.EventViewModel
@{
    ViewBag.Title = "Create";
}


<form class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4" id="NewEvent" action="@Url.Action("Update", "Event")" method="post">
    @Html.HiddenFor(model => model.EventToModify.ID)
    @Html.HiddenFor(model => Model.EventToModify.Owner.ID, new { @Value = Model.CurrUser.ID })
    <div class="col-xs-12 form-group">
        <label class="control-label">Title</label>
        @Html.TextBoxFor(model => model.EventToModify.Title, new { @placeholder = "Title", @class = "form-control required" })
    </div>
    <div class="input-daterange">
        <div class="col-xs-12 col-sm-6 form-group">
            <label class="control-label">Start Date</label>
            @Html.TextBoxFor(model => model.EventToModify.StartDate, new { @Value = Model.EventToModify.StartDate.ToString("MM/dd/yyyy"), @placeholder = "Start Date", @class = "form-control required customDate" })
        </div>
        <div class="col-xs-12 col-sm-6 form-group" >
            <label class="control-label">End Date</label>
            @Html.TextBoxFor(model => model.EventToModify.EndDate, new { @Value = Model.EventToModify.EndDate.ToString("MM/dd/yyyy"), @placeholder = "End Date", @class = "form-control required customDate" })
        </div>
    </div>
    <div class="col-xs-12 form-group">
        <label class="control-label">Description</label>
        @Html.TextAreaFor(model => Model.EventToModify.Description, new { @class = "form-control required" })
    </div>

    <div class="col-xs-12">
        @if (Model.EventToModify.ID != 0)
        {
            <div class="btn-group">
                <a class="btn btn-lg btn-danger rounded" onclick="$(this).removeClass('rounded'); $(this).siblings('.btn').slideDown(200)" href="#">Delete Event?</a>
                <a class="btn btn-lg btn-danger" href="@Url.Action("Delete", "Event", new {@EventID = Model.EventToModify.ID})" style="display:none">Yes</a>
            </div>
        }
        <button class="btn btn-lg btn-primary pull-right">Submit</button>
    </div>
</form>
<script>
    $(function () {
        $('.input-daterange').datepicker({ startDate: "0d" });
    })
</script>